﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace ShopCartOnline.Models
{
    [Table("TaiKhoan")]
    public class TaiKhoan
    {
        [Key]
        public int MaNguoiDung { get; set; }

        [Required]
        [Column(TypeName = "varchar")]
        [StringLength(50)]
        public string TenTaiKhoan { get; set; }

        [Required]
        [Column(TypeName = "varchar")]
        [StringLength(50)]
        public string MatKhau { get; set; }

        [Required]
        [Column(TypeName = "bit")]
        [DefaultValue(false)]
        public bool TrangThai { get; set; }

        [Required]
        [Column(TypeName = "varchar")]
        [StringLength(3)]
        public string Quyen { get; set; }

        [Required]
        [Column(TypeName = "varchar")]
        [StringLength(10)]
        public string MaKichHoat { get; set; }

        [Required]
        public DateTime NgayTao { get; set; }

        [Required]
        public DateTime NgayThayDoiMatKhau { get; set; }

        [Required]
        public DateTime LanDangNhapCuoi { get; set; }

        //Tham chiếu khóa ngoại tới bảng người dùng
        [ForeignKey("MaNguoiDung")]
        public NguoiDung NguoiDung { get; set; }
        
    }
}